Given a collection of numbers, nums , that might contain duplicates, return all possible unique permutations in any order.
Input: nums = [1, 1, 2] Output: [[1, 1, 2], [1, 2, 1], [2, 1, 1]]
Input: nums = [1, 2, 3] Output: [[1,2,3], [1, 3,2], [2,1,3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
Constraints: 1 <= nums.length <= 8 -10 <= nums[i] <= 10
The main idea was using lexicographically ascending order approach when generating the permutation tuples. All other details could be explained during tech interview (of course, in case if it could be at all).
Given a string of round, curly, and square open and closing brackets, return whether the brackets are balanced (well-formed).
Given the string [] ( { } ) " should return true. Given the string ( [ ) ] or ( ( ( ) should return false.
HA! This kind of tasks we did when were students and had a work to write a lexical parser for any "invented" programming language! So... this quiz was done with pleasure))
Thanks!
MIT