Refactored all solutions
This commit is contained in:
@@ -5,12 +5,15 @@
|
||||
import java.util.Scanner;
|
||||
import java.util.Stack;
|
||||
|
||||
// Runtime: O(n)
|
||||
// Time Complexity: O(n)
|
||||
// Space Complexity: O(n)
|
||||
|
||||
// Can alternatively use an ArrayDeque instead of a Stack. Just make sure to iterate
|
||||
// through it properly since iteration order is opposite that of a Stack.
|
||||
|
||||
public class Solution {
|
||||
public static void main(String[] args) {
|
||||
/* Read and save input */
|
||||
public static void main(String [] args) {
|
||||
/* Save input */
|
||||
Scanner scan = new Scanner(System.in);
|
||||
String str = scan.next();
|
||||
scan.close();
|
||||
|
||||
Reference in New Issue
Block a user