Easy Solution|| Java||100% BEAT
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Easy Solution \n# Complexity\n- Time complexity:\nO(1)\n\n- Space comple
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n Easy Solution \n# Complexity\n- Time complexity:\nO(1)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\n    int i=0,j=0;\n     int m=0;int n=0;\n\n    public Solution(int m, int n) {\n        this.m=m;\n        this.n=n;\n    }\n    \n    public int[] flip() {\n        j++;\n        if(j==n){\n            j=0;\n            i++;\n        }\n        if(i==m){\n            i=0;\n            j=0;\n        }\n\n             \n        return new int[]{i,j};\n        \n    }\n    \n    public void reset() {\n      \n        \n        \n        \n    }\n}\n\n/**\n * Your Solution object will be instantiated and called as such:\n * Solution obj = new Solution(m, n);\n * int[] param_1 = obj.flip();\n * obj.reset();\n */\n```
['Java']