Approach - String Lexicographical Way

Please check code, the test case is not passing