269. Alien Dictionary

There is a new alien language that uses the English alphabet. However, the order among the letters is unknown to you. You are given a list of strings words from the alien language’s dictionary, where the strings in words are sorted lexicographically by the rules of this new language. Return a string of the unique letters in the new alien language sorted in lexicographically increasing order by the new language’s rules....

<span title='2022-01-29 00:00:00 +0000 UTC'>January 29, 2022</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;volyx

679. 24 Game

You are given an integer array cards of length 4. You have four cards, each containing a number in the range [1, 9]. You should arrange the numbers on these cards in a mathematical expression using the operators [’+’, ‘-’, ‘*’, ‘/’] and the parentheses ‘(’ and ‘)’ to get the value 24. You are restricted with the following rules: The division operator ‘/’ represents real division, not integer division....

<span title='2022-01-13 00:00:00 +0000 UTC'>January 13, 2022</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;volyx

772. Basic Calculator III

Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, ‘+’, ‘-’, ‘*’, ‘/’ operators, and open ‘(’ and closing parentheses ‘)’. The integer division should truncate toward zero. You may assume that the given expression is always valid. All intermediate results will be in the range of [-231, 231 - 1]. Note: You are not allowed to use any built-in function which evaluates strings as mathematical expressions, such as eval()....

<span title='2021-12-12 00:00:00 +0000 UTC'>December 12, 2021</span>&nbsp;·&nbsp;3 min&nbsp;·&nbsp;volyx

736. Parse Lisp Expression

You are given a string expression representing a Lisp-like expression to return the integer value of. The syntax for these expressions is given as follows. -An expression is either an integer, let expression, add expression, mult expression, or an assigned variable. Expressions always evaluate to a single integer. (An integer could be positive or negative.) A let expression takes the form “(let v1 e1 v2 e2 … vn en expr)”, where let is always the string “let”, then there are one or more pairs of alternating variables and expressions, meaning that the first variable v1 is assigned the value of the expression e1, the second variable v2 is assigned the value of the expression e2, and so on sequentially; and then the value of this let expression is the value of the expression expr....

<span title='2021-12-11 00:00:00 +0000 UTC'>December 11, 2021</span>&nbsp;·&nbsp;4 min&nbsp;·&nbsp;volyx

472. Concatenated Words

Given an array of strings words (without duplicates), return all the concatenated words in the given list of words. A concatenated word is defined as a string that is comprised entirely of at least two shorter words in the given array. 1 2 3 4 5 6 7 8 9 10 11 12 Example 1: Input: words = ["cat","cats","catsdogcats","dog","dogcatsdog","hippopotamuses","rat","ratcatdogcat"] Output: ["catsdogcats","dogcatsdog","ratcatdogcat"] Explanation: "catsdogcats" can be concatenated by "cats", "dog" and "cats"; "dogcatsdog" can be concatenated by "dog", "cats" and "dog"; "ratcatdogcat" can be concatenated by "rat", "cat", "dog" and "cat"....

<span title='2021-12-10 00:00:00 +0000 UTC'>December 10, 2021</span>&nbsp;·&nbsp;4 min&nbsp;·&nbsp;volyx

332. Reconstruct Itinerary

You are given a list of airline tickets where tickets[i] = [fromi, toi] represent the departure and the arrival airports of one flight. Reconstruct the itinerary in order and return it. All of the tickets belong to a man who departs from “JFK”, thus, the itinerary must begin with “JFK”. If there are multiple valid itineraries, you should return the itinerary that has the smallest lexical order when read as a single string....

<span title='2021-11-29 00:00:00 +0000 UTC'>November 29, 2021</span>&nbsp;·&nbsp;3 min&nbsp;·&nbsp;volyx

126. Word Ladder II

A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> … -> sk such that: Every adjacent pair of words differs by a single letter. Every si for 1 <= i <= k is in wordList. Note that beginWord does not need to be in wordList. sk == endWord Given two words, beginWord and endWord, and a dictionary wordList, return all the shortest transformation sequences from beginWord to endWord, or an empty list if no such sequence exists....

<span title='2021-11-25 00:00:00 +0000 UTC'>November 25, 2021</span>&nbsp;·&nbsp;3 min&nbsp;·&nbsp;volyx

815. Bus Routes

You are given an array routes representing bus routes where routes[i] is a bus route that the ith bus repeats forever. For example, if routes[0] = [1, 5, 7], this means that the 0th bus travels in the sequence 1 -> 5 -> 7 -> 1 -> 5 -> 7 -> 1 -> … forever. You will start at the bus stop source (You are not on any bus initially), and you want to go to the bus stop target....

<span title='2021-11-24 00:00:00 +0000 UTC'>November 24, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;volyx

76. Minimum Window Substring

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string “”. The testcases will be generated such that the answer is unique. A substring is a contiguous sequence of characters within the string. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Example 1: Input: s = "ADOBECODEBANC", t = "ABC" Output: "BANC" Explanation: The minimum window substring "BANC" includes 'A', 'B', and 'C' from string t....

<span title='2021-11-23 00:00:00 +0000 UTC'>November 23, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;volyx

282. Expression Add Operators

Given a string num that contains only digits and an integer target, return all possibilities to insert the binary operators ‘+’, ‘-’, and/or ‘*’ between the digits of num so that the resultant expression evaluates to the target value. Note that operands in the returned expressions should not contain leading zeros. 1 2 3 4 5 Example 1: Input: num = "123", target = 6 Output: ["1*2*3","1+2+3"] Explanation: Both "1*2*3" and "1+2+3" evaluate to 6....

<span title='2021-11-20 00:00:00 +0000 UTC'>November 20, 2021</span>&nbsp;·&nbsp;3 min&nbsp;·&nbsp;volyx

158. Read N Characters Given read4 II - Call Multiple Times

Given a file and assume that you can only read the file using a given method read4, implement a method read to read n characters. Your method read may be called multiple times. Method read4: The API read4 reads four consecutive characters from file, then writes those characters into the buffer array buf4. The return value is the number of actual characters read. Note that read4() has its own file pointer, much like FILE *fp in C....

<span title='2021-11-09 00:00:00 +0000 UTC'>November 9, 2021</span>&nbsp;·&nbsp;5 min&nbsp;·&nbsp;volyx

1269. Number of Ways to Stay in the Same Place After Some Steps

You have a pointer at index 0 in an array of size arrLen. At each step, you can move 1 position to the left, 1 position to the right in the array, or stay in the same place (The pointer should not be placed outside the array at any time). Given two integers steps and arrLen, return the number of ways such that your pointer still at index 0 after exactly steps steps....

<span title='2021-11-07 00:00:00 +0000 UTC'>November 7, 2021</span>&nbsp;·&nbsp;3 min&nbsp;·&nbsp;volyx

489. Robot Room Cleaner

You are controlling a robot that is located somewhere in a room. The room is modeled as an m x n binary grid where 0 represents a wall and 1 represents an empty slot. The robot starts at an unknown location in the root that is guaranteed to be empty, and you do not have access to the grid, but you can move the robot using the given API Robot....

<span title='2021-10-26 00:00:00 +0000 UTC'>October 26, 2021</span>&nbsp;·&nbsp;4 min&nbsp;·&nbsp;volyx

23. Merge k Sorted Lists

You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it. 1 2 3 4 5 6 7 8 9 10 11 12 Example 1: Input: lists = [[1,4,5],[1,3,4],[2,6]] Output: [1,1,2,3,4,4,5,6] Explanation: The linked-lists are: [ 1->4->5, 1->3->4, 2->6 ] merging them into one sorted list: 1->1->2->3->4->4->5->6 1 2 3 4 Example 2: Input: lists = [] Output: [] 1 2 3 4 Example 3: Input: lists = [[]] Output: [] Constraints:...

<span title='2021-10-19 00:00:00 +0000 UTC'>October 19, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;volyx

951. Flip Equivalent Binary Trees

For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees. A binary tree X is flip equivalent to a binary tree Y if and only if we can make X equal to Y after some number of flip operations. Given the roots of two binary trees root1 and root2, return true if the two trees are flip equivelent or false otherwise....

<span title='2021-10-19 00:00:00 +0000 UTC'>October 19, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;volyx