MCPcopy Create free account
hub / github.com/Hsinha11/Leetcode-solutions / main

Method main

-68-Text_Justification/Code.java:54–72  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

52 }
53
54 public static void main(String[] args) {
55 Scanner sc = new Scanner(System.in);
56 System.out.print("Enter number of words: ");
57 int n = sc.nextInt();
58 String[] words = new String[n];
59 System.out.println("Enter words:");
60 for (int i = 0; i < n; i++)
61 words[i] = sc.next();
62
63 System.out.print("Enter max width: ");
64 int maxWidth = sc.nextInt();
65
66 Solution sol = new Solution();
67 List<String> result = sol.fullJustify(words, maxWidth);
68
69 System.out.println("\nJustified Text:");
70 for (String line : result)
71 System.out.println('"' + line + '"');
72 }
73}

Callers

nothing calls this directly

Calls 1

fullJustifyMethod · 0.95

Tested by

no test coverage detected