This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Workflow Orchestration | |
| ## 1. Plan Mode Default | |
| - Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions) | |
| - If something goes sideways, STOP and re-plan immediately — don't keep pushing | |
| - Use plan mode for verification steps, not just building | |
| - Write detailed specs upfront to reduce ambiguity | |
| ## 2. Subagent Strategy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LongestSubstring { | |
| public int lengthOfLongestSubstring(String s) { | |
| if(s.length() == 1) | |
| return 1; | |
| int longestStrLength = 0; | |
| int begin=0; | |
| int foundedIndx=0; | |
| Set<Character> characters = new HashSet<>(); | |
| for (int i = 0; i < s.length(); i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Definition for a binary tree node. | |
| * public class TreeNode { | |
| * int val; | |
| * TreeNode left; | |
| * TreeNode right; | |
| * TreeNode() {} | |
| * TreeNode(int val) { this.val = val; } | |
| * TreeNode(int val, TreeNode left, TreeNode right) { | |
| * this.val = val; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Definition for a binary tree node. | |
| * public class TreeNode { | |
| * int val; | |
| * TreeNode left; | |
| * TreeNode right; | |
| * TreeNode() {} | |
| * TreeNode(int val) { this.val = val; } | |
| * TreeNode(int val, TreeNode left, TreeNode right) { | |
| * this.val = val; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MissingNumber { | |
| public int missingNumber(int[] nums) { | |
| int sum = 0; | |
| int maxNum = -1; | |
| boolean isZeroExist = false; | |
| for (int i = 0; i < nums.length; i++) | |
| { | |
| sum += nums[i]; | |
| if(nums[i] > maxNum) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution { | |
| public String addBinary(String a, String b) { | |
| char[] summaryArray = new char[Math.max(a.length(), b.length()) + 1]; | |
| String shortBits, longBits; | |
| if(a.length() > b.length()) | |
| { | |
| shortBits = new String(b); | |
| longBits = new String(a); | |
| } | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution { | |
| public int longestConsecutive(int[] nums) { | |
| if(nums.length<1) | |
| return 0; | |
| if(nums.length == 1) | |
| return 1; | |
| UnionFind uf = new UnionFind(nums); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution { | |
| public int jump(int[] nums) { | |
| if(nums.length == 1) | |
| return 0; | |
| int jumpCount = 0; | |
| int startIndex=0; | |
| int maxValue = -1; | |
| int maxValueIndx = -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution { | |
| public int trap(int[] height) { | |
| if(height.length < 2) | |
| return 0; | |
| int totalTrappingArea = 0; | |
| if(height[0] > height[height.length-1]) | |
| { |