1. Shortest Route Problem Statement You want to visit your friend’s house located at some position in an infinite grid starting from origin (0, 0). You can move in four directions: East (E), West (W), North (N), and South (S). Your friend gives you a directional string STR representing a route to their house. You need to determine the shortest possible route, minimizing the number of steps, and return the route that is also lexicographically smallest. Input: The first line of the input contains an integer T, the number of test cases.Each of the next T lines contains a string STR of length N, representing the route. Output: For each test case, output a single line with the shortest lexicographical route string to your friend's house. Example: Input:1NNSEWEEOutput:EEN Explanation: For the test case where STR = "NNSEWEE", the smallest route to reach the destination (2, 1) from origin (0, 0) is 'EEN'. This route is lexicographically smallest among other options like 'NEE', 'ENE'. Constraints: 1 <= T <= 50 1 <= N <= 10^4 STR contains only characters 'E', 'W', 'N', 'S' Time limit: 1 sec. Note: You do not need to print anything; the function only needs to return the final result.
2. Implement depth-first search in a tree.
3. What is Node.js?
4. What is Observable in Swift?
5. Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”
Browse through a variety of job opportunities tailored to your skills and preferences. Filter by location, experience, salary, and more to find your perfect fit.