GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — leetcode/java/1323_Maximum_69_Number.java at master · jsflzhong/leetcode Expand file tree/ Copy path1323_Maximum_69_Number.javaMore file actions 19 lines (18 loc) · 566 Bytes / Copy path1323_Maximum_69_Number.javaFile metadata and controls19 lines (18 loc) · 566 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 class Solution { public int maximum69Number (int num) { // Replace first 6 with 9 if exists return Integer.valueOf(String.valueOf(num).replaceFirst("6", "9")); } /* public int maximum69Number (int num) { char[] chars = Integer.toString(num).toCharArray(); // Replace first 6 with 9 if exists for (int i = 0; i < chars.length; i++) { if (chars[i] == '6') { chars[i] = '9'; break; } } return Integer.parseInt(new String(chars)); }*/ } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |