Feb 19 · 2 min read · Question You are given an array of strings tokens that represents a valid arithmetic expression in Reverse Polish Notation. Return the integer that represents the evaluation of the expression. The operands may be integers or the results of other ope...
Join discussionFeb 18 · 3 min read · Question Design a stack class that supports the push, pop, top, and getMin operations. MinStack() initializes the stack object. void push(int val) pushes the element val onto the stack. void pop() removes the element on the top of the stack. int ...
Join discussionFeb 16 · 2 min read · Question You are given a string s consisting of the following characters: '(', ')', '{', '}', '[' and ']'. The input string s is valid if and only if: Every open bracket is closed by the same type of close bracket. Open brackets are closed in the c...
Join discussionFeb 15 · 3 min read · Question Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] where nums[i] + nums[j] + nums[k] == 0, and the indices i, j and k are all distinct. The output should not contain any duplicate triplets. You may return the ou...
Join discussionFeb 13 · 2 min read · Question Given an array of integers numbers that is sorted in non-decreasing order. Return the indices (1-indexed) of two numbers, [index1, index2], such that they add up to a given target number target and index1 < index2. Note that index1 and index...
Join discussionFeb 12 · 2 min read · Question Given a string s, return true if it is a palindrome, otherwise return false. A palindrome is a string that reads the same forward and backward. It is also case-insensitive and ignores all non-alphanumeric characters. Note: Alphanumeric chara...
Join discussion