Android Unlock Patterns Leetcode Javascript Solution