add leetcode add binary solution and refactor code