Domanda di colloquio di ShareChat

First Round (HackerEarth Assessment): Problem 1: XOR sum query. (Can solve using segment tree). Problem2: Alphabetical String. While creating an account on a new website, you choose a certain string of letters as your new password. However, you are alerted that the website requires your password to be an alphabetical string. It explains: “A string of lowercase letters is called Alphabetical if deleting zero or more of its letters can result in the alphabetical string abcdefghijklmnopqrstuvwxyz.” Because of this requirement, you need to be sure that your password is alphabetical. Your goal is to find the minimum a number of letters that must be inserted in order to make your password alphabetical. Example: Given string S: “xyzabcdefghijklmnopqrstuvw”. The optimal solution is to insert “xyz” in the end of the string to obtain the alphabetical string “xyzabcdefghijklmnopqrstuvwxyz”. Note that this is alphabetical because if you delete the first three letters “xyz”. It results in the alphabet string “abcdefghijklmnopqrstuvwxyz”. Because this requires three-letter insertions. There is no way to make fewer than three insertions and end up with an alphabetical string. [I have solved this problem with Longest Common Subsequence.] Problem3: Don't Remember. Round 2:(Code Pair) There were 4 problems. I was able to solve only one problem (It was a CodeChef problem Help "The Cruise Chef"). The problem was statement was very confusing.