1021. Remove Outermost Parentheses
class Solution { public String removeOuterParentheses(String s) { StringBuilder result = new StringBuilder(); int depth = 0; for (char c : s.toCharArray()) { if (c == '(') { if (depth > 0) { ...
Search for a command to run...
Articles tagged with #programming
class Solution { public String removeOuterParentheses(String s) { StringBuilder result = new StringBuilder(); int depth = 0; for (char c : s.toCharArray()) { if (c == '(') { if (depth > 0) { ...
class Solution { public String removeOuterParentheses(String s) { StringBuilder result = new StringBuilder(); int depth = 0; for (char c : s.toCharArray()) { if (c == '(') { if (depth > 0) { ...
select a1.machine_id, round(avg(a2.timestamp-a1.timestamp), 3) as processing_time from activity a1 join activity a2 on a1.machine_id=a2.machine_id and a1.process_id=a2.process_id and a1.activity_type='start' and a2.activity_type='end' group by a1.ma...
SELECT w1.id FROM Weather w1 JOIN Weather w2 ON DATEDIFF(w1.recordDate, w2.recordDate) = 1 WHERE w1.temperature > w2.temperature;
SELECT v.customer_id, COUNT(v.visit_id) AS count_no_trans FROM Visits v LEFT JOIN Transactions t ON v.visit_id = t.visit_id WHERE t.transaction_id IS NULL GROUP BY v.customer_id;
class Solution { public List<String> generateParenthesis(int n) { List<String> res = new ArrayList<String>(); recurse(res,0,0,"",n); return res; } public void recurse(List<String> res, int left, int right, String ...