(String s)
| 1 | class Solution { |
| 2 | public String clearDigits(String s) { |
| 3 | StringBuilder sb = new StringBuilder(); |
| 4 | int n = s.length(); |
| 5 | for(int i=0;i<n;i++){ |
| 6 | if(!Character.isDigit(s.charAt(i))){ |
| 7 | sb.append(s.charAt(i)); |
| 8 | }else{ |
| 9 | if(sb.length()!=0){ |
| 10 | sb.deleteCharAt(sb.length()-1); |
| 11 | } |
| 12 | } |
| 13 | } |
| 14 | return sb.toString(); |
| 15 | } |
| 16 | } |
nothing calls this directly
no outgoing calls
no test coverage detected