Java O(N) Solution [Shortest]
I have implemented BitMasking with HashMap since ther is only 10 possible characters.\n\npublic int longestAwesome(String s) {\n        \n        \n        int 
I have implemented BitMasking with HashMap since ther is only 10 possible characters.\n```\npublic int longestAwesome(String s) {\n        \n        \n        int l=s.length(),x=0,res=0;\n        HashMap<Integer,Integer> h=new HashMap<>();\n        h.put(0,-1);\n        for(int i=0;i<l;i++)\n        {\n            x=x^(1<<(s.charAt(i)-\'0\'));\n            if(h.containsKey(x))\n            res=Math.max(res,i-h.get(x));\n            else\n            h.put(x,i);\n            \n            for(int j=0;j<10;j++)\n            {\n                if(h.containsKey(x^(1<<j)))\n                res = Math.max(res,i-h.get(x^(1<<j)));\n            }\n        }\n        return res;\n        \n    }\n```\n\nIncase, of any explanation is required for the above solution, let me know.
['Dynamic Programming', 'Bitmask']