Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. import java.util.*;
  2. import java.io.*;
  3. import java.math.*;
  4.  
  5. /**
  6. * Auto-generated code below aims at helping you parse
  7. * the standard input according to the problem statement.
  8. **/
  9. class Solution {
  10.  
  11. public List<String> getGolfPathArray(List<String> rows, int furthest) {
  12. for(int i = 0; i < rows.size(); i++) {
  13.  
  14. }
  15.  
  16. return rows;
  17. }
  18.  
  19. public int getFurthest(List<String> rows) {
  20.  
  21. for(int i = 0; i < rows.size(); i++) {
  22.  
  23. }
  24. }
  25.  
  26. public static void main(String args[]) {
  27. Scanner in = new Scanner(System.in);
  28. int width = in.nextInt();
  29. int height = in.nextInt();
  30.  
  31. int numberOfHoles = 0;
  32. List<String> rows = new ArrayList<>();
  33. for (int i = 0; i < height; i++) {
  34. String input = in.next();
  35. rows.add(input);
  36. numberOfHoles += input.length() - input.replaceAll("H","").length();
  37. }
  38.  
  39. for(int i = 0; i < numberOfHoles; i++)
  40. rows = getGolfPathArray(rows, getFurthest(rows));
  41. for(String r : rows)
  42. System.out.println(r);
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement