0% found this document useful (0 votes)
2 views14 pages

Leetcode Prob

The document outlines a structured training program for Java problem-solving fundamentals over two phases, focusing on building confidence in Java programming and solving LeetCode problems. Phase 1A covers basic concepts such as I/O, operators, control flow, and functions, while Phase 1B emphasizes arrays and strings, with a cumulative target of 230 LeetCode problems. Each day includes specific topics, hands-on problems, and daily targets to ensure students develop their skills effectively.

Uploaded by

kaityson9043
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views14 pages

Leetcode Prob

The document outlines a structured training program for Java problem-solving fundamentals over two phases, focusing on building confidence in Java programming and solving LeetCode problems. Phase 1A covers basic concepts such as I/O, operators, control flow, and functions, while Phase 1B emphasizes arrays and strings, with a cumulative target of 230 LeetCode problems. Each day includes specific topics, hands-on problems, and daily targets to ensure students develop their skills effectively.

Uploaded by

kaityson9043
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PHASE 1A: JAVA PROBLEM SOLVING FUNDAMENTALS

Duration: 6 Days x 6 Hours = 36 Hours


LeetCode Target: 100 Problems
Phase Objective:
To build Java programming confidence from the basics: input/output, operators, conditional statements,
control flow, loops, functions and simple logic building.

Expected Outcome:
Students should be able to solve basic LeetCode problems independently using Java.

Day 1: Java Setup, Basic I/O and First Programs


Topics:
●​ Java program structure
●​ class and main method
●​ [Link] and println
●​ Scanner input
●​ Reading int, long, double, char and String
●​ Common syntax errors
●​ Online judge input/output style
●​ Multiple test case input
format Hands-on Problems:
●​ Add two numbers
●​ Area of circle
●​ Simple interest
●​ Swap two numbers
●​ Read and print student details
●​ Calculate average marks
●​ Convert Celsius to Fahrenheit
●​ Final value after operations
[Link] [Link]
●​ 2235 Add Two Integers
●​ 2011 Final Value of Variable After Performing Operations
●​ 1920 Build Array from Permutation
●​ 1672 Richest Customer Wealth
●​ 1342 Number of Steps to Reduce a Number
to Zero Daily Target:
15 to 18 LeetCode easy problems
Day 2: Operators and Expressions
Topics:
●​ Arithmetic operators
●​ Relational operators
●​Logical operators
●​ Assignment operators
●​Increment and decrement
●​ Modulus operator
●​ Operator precedence
●​Integer division
●​ Type casting
●​ Overflow
awareness Hands-on
Problems:
●​ Odd or even
●​Last digit of a number
●​ Sum of digits
●​ Reverse number
●​ Check divisibility
●​ Count digits
●​ Product and sum of digits
●​ Power using loop
[Link] [Link]
●​ 9 Palindrome Number
●​ 7 Reverse Integer
●​ 258 Add Digits
●​ 1281 Subtract Product and Sum of Digits
●​ 2520 Count the Digits That Divide a
Number Daily Target:
15 to 18 LeetCode easy problems
Day 3: Conditional Statements
Topics:
●​ if
●​ if-else
●​ else-if ladder
●​ nested if
●​ switch
●​ Conditional decision making
●​ Edge case thinking

Hands-on Problems:
●​Largest of three numbers
●​ Grade calculator
●​Leap year
●​ Electricity bill
●​ Salary bonus
●​ Character type check
●​ Calculator using switch
●​ Valid triangle

[Link] [Link]
●​ 412 Fizz Buzz
●​ 292 Nim Game
●​ 507 Perfect Number
●​ 3136 Valid Word
●​ 1812 Determine Color of a Chessboard Square

Daily Target:
15 to 18 LeetCode easy problems

Day 4: Loops and Control Flow


Topics:
●​ for loop
●​ while loop
●​ do-while loop
●​ nested loops
●​ break
●​ continue
●​Loop dry run
●​Infinite loop debugging

Hands-on Problems:
●​ Print 1 to n
●​ Factorial
●​ Fibonacci
●​ Prime number
●​ GCD and LCM
●​ Multiplication table
●​ Armstrong number
●​ Star patterns

[Link] [Link]
●​ 509 Fibonacci Number
●​ 1137 N-th Tribonacci Number
●​ 1952 Three Divisors
●​ 1523 Count Odd Numbers in an Interval Range
●​ 441 Arranging Coins

Daily Target:
15 to 18 LeetCode easy problems

Day 5: Functions and Problem Decomposition


Topics:
●​ Method declaration
●​ Method parameters
●​ Return values
●​ void methods
●​ static methods
●​ Helper methods
●​ Reusable code
●​ Breaking a problem into smaller functions

Hands-on Problems:
●​ Method for prime check
●​ Method for factorial
●​ Method for reverse number
●​ Method for palindrome
●​ Method for sum of digits
●​ Method for GCD
●​ Method for power calculation
●​ Method for grade calculation

[Link] [Link]
●​ 69 Sqrt(x)
●​ 367 Valid Perfect Square
●​ 171 Excel Sheet Column Number
●​ 168 Excel Sheet Column Title
●​ 13 Roman to Integer

Daily Target:
15 to 18 LeetCode easy problems

Day 6: Fundamentals Revision and Basic LeetCode Mock


Topics:
●​ Complete revision of I/O, operators, conditions, loops and functions
●​ Debugging common Java errors
●​ Time complexity basics
●​ Space complexity basics
●​ Edge cases
●​LeetCode submission discipline

Mock Test:
●​ Problem 1: Number logic
●​ Problem 2: Loop-based logic
●​ Problem 3: String or array input reading
●​ Problem 4: Function-based solution

Gate for Phase 1A:


●​ 100 LeetCode problems completed
●​ Basic Java mock score minimum 70 percent
●​ Ability to explain 5 solved problems

[Link] [Link]
Suggested Phase 1A LeetCode Problem Bank:
2235 Add Two Integers, 2011 Final Value of Variable After Performing Operations, 1920 Build Array from
Permutation, 1929 Concatenation of Array, 1480 Running Sum of 1d Array, 1672 Richest Customer Wealth,
1470 Shuffle the Array, 1512 Number of Good Pairs, 1431 Kids With the Greatest Number of Candies, 1108
Defanging an IP Address, 771 Jewels and Stones, 1528 Shuffle String, 1678 Goal Parser Interpretation, 2114
Maximum Number of Words Found in Sentences, 1816 Truncate Sentence, 709 To Lower Case, 1768 Merge
Strings Alternately, 344 Reverse String, 557 Reverse Words in a String III, 13 Roman to Integer, 9
Palindrome Number, 7 Reverse Integer, 258 Add Digits, 1281 Subtract Product and Sum of Digits, 1342
Number of Steps to Reduce a Number to Zero, 1295 Find Numbers with Even Number of Digits, 2520 Count
the Digits That Divide a Number, 1137 N-th Tribonacci Number, 509 Fibonacci Number, 412 Fizz Buzz, 69
Sqrt(x), 367 Valid Perfect Square, 231 Power of Two, 326 Power of Three, 342 Power of Four, 507 Perfect
Number, 202 Happy Number, 263 Ugly Number, 292 Nim Game, 58 Length of Last Word, 14 Longest
Common Prefix, 20 Valid Parentheses, 125 Valid Palindrome, 242 Valid Anagram, 205 Isomorphic Strings,
290 Word Pattern, 383 Ransom Note, 389 Find the Difference, 409 Longest Palindrome, 434 Number of
Segments in a String, 459 Repeated Substring Pattern, 520 Detect Capital, 551 Student Attendance Record I,
859 Buddy Strings, 917 Reverse Only Letters, 925 Long Pressed Name, 929 Unique Email Addresses, 944
Delete Columns to Make Sorted, 953 Verifying an Alien Dictionary, 1047 Remove All Adjacent Duplicates
In String, 1071 Greatest Common Divisor of Strings, 1189 Maximum Number of Balloons, 1704 Determine
if String Halves Are Alike, 1832 Check if Sentence Is Pangram.

===========================================================
= PHASE 1B: LEETCODE-FOCUSED ARRAYS AND STRINGS
Duration: 6 Days x 6 Hours = 36 Hours
LeetCode Target: 130 Problems
Cumulative Target After Phase 1B: 230 Problems
============================================================

Phase Objective:
To build strong LeetCode problem-solving ability in arrays and strings.

Expected Outcome:
Students should be able to solve LeetCode Easy and selected Medium problems from arrays and strings.

Day 7: Array Basics and Traversal Patterns

[Link] [Link]
Topics:
●​ Array declaration and initialization
●​ Array traversal
●​ Updating array values
●​ Passing arrays to methods
●​ Maximum and minimum
●​ Second largest
●​ Count frequency
●​ Edge cases in arrays

Hands-on Problems:
●​ Sum of array
●​ Maximum and minimum
●​ Second largest
●​ Count even and odd
●​ Check sorted array
●​ Reverse array

LeetCode Focus:
●​ 1480 Running Sum of 1d Array
●​ 1920 Build Array from Permutation
●​ 1929 Concatenation of Array
●​ 1470 Shuffle the Array
●​ 485 Max Consecutive Ones
●​ 1295 Find Numbers with Even Number of Digits

Day 8: Array Modification and Frequency Patterns

[Link] [Link]
Topics:

●​In-place update
●​ Move zeroes
●​ Remove duplicates
●​ Missing number
●​ Duplicate number
●​ Frequency array
●​ HashSet awareness

Hands-on Problems:
●​ Move zeroes
●​ Remove duplicates
●​ Missing number
●​ Contains duplicate
●​ Set mismatch
●​Intersection of arrays

LeetCode Focus:
●​ 283 Move Zeroes
●​ 26 Remove Duplicates from Sorted Array
●​ 268 Missing Number
●​ 217 Contains Duplicate
●​ 645 Set Mismatch
●​ 349 Intersection of Two Arrays

Day 9: Prefix Sum and Subarray Patterns


Topics:
●​ Prefix sum

[Link] [Link]
●​ Range sum

●​ Pivot index
●​ Subarray basics
●​ Maximum subarray brute force
●​ Kadane's algorithm
●​ Maximum average
●​ Odd length subarray sum

Hands-on Problems:
●​ Prefix sum array
●​ Range sum query
●​ Pivot index
●​ Maximum subarray
●​ Maximum average subarray
●​ Sum of odd length subarrays

LeetCode Focus:
●​ 724 Find Pivot Index
●​ 303 Range Sum Query Immutable
●​ 53 Maximum Subarray
●​ 643 Maximum Average Subarray I
●​ 1588 Sum of All Odd Length Subarrays

Day 10: Sorting, Binary Search and Two Pointers

Topics:
●​ [Link]
●​ Sorting-based logic
●​ Binary search

[Link] [Link]
●​ Search insert position

●​Lower bound and upper bound awareness


●​ Two-pointer technique
●​ Pair sum
●​ Squares of sorted array

Hands-on Problems:
●​ Binary search
●​ Search insert position
●​ Squares of sorted array
●​ Two sum sorted
●​ Pair sum
●​ Merge sorted arrays

LeetCode Focus:
●​ 704 Binary Search
●​ 35 Search Insert Position
●​ 977 Squares of a Sorted Array
●​ 167 Two Sum II
●​ 88 Merge Sorted Array
●​ 1539 Kth Missing Positive Number

Day 11: String Basics and Frequency Patterns

Topics:
●​ String immutability
●​ charAt
●​ substring
●​ equals

[Link] [Link]
●​ StringBuilder

●​ ASCII
●​ Frequency count
●​ Anagram
●​ Palindrome

Hands-on Problems:
●​ Reverse string
●​ Valid palindrome
●​ Valid anagram
●​ First unique character
●​ Ransom note
●​ Count consistent strings

LeetCode Focus:
●​ 344 Reverse String
●​ 125 Valid Palindrome
●​ 242 Valid Anagram
●​ 387 First Unique Character in a String
●​ 383 Ransom Note
●​ 1832 Check if Sentence Is Pangram

Day 12: String Two Pointers, Stack-Like Strings and Mock

Topics:
●​ Reverse vowels
●​ Backspace compare
●​ Remove adjacent duplicates
●​Longest common prefix

[Link] [Link]
●​ Repeated substring pattern

●​ Word pattern
●​Isomorphic strings
●​ String mock assessment

Hands-on Problems:
●​Longest common prefix
●​ Reverse words
●​ Remove adjacent duplicates
●​ Backspace string compare
●​ Repeated substring pattern
●​Isomorphic strings

Mock Test:
●​ Problem 1: Array traversal
●​ Problem 2: Prefix sum
●​ Problem 3: String frequency
●​ Problem 4: Two pointers

Gate for Phase 1B:


●​ 230 cumulative LeetCode problems completed
●​ Arrays and strings mock score minimum 70 percent

Suggested Phase 1B LeetCode Problem Bank:


1 Two Sum, 26 Remove Duplicates from Sorted Array, 27 Remove Element, 35 Search Insert Position, 66
Plus One, 88 Merge Sorted Array, 121 Best Time to Buy and Sell Stock, 136 Single Number, 169 Majority
Element, 217 Contains Duplicate, 219 Contains Duplicate II, 228 Summary Ranges, 268 Missing Number,
283 Move Zeroes, 349 Intersection of Two Arrays, 350 Intersection of Two Arrays II, 414 Third Maximum
Number, 448 Find All Numbers Disappeared in an Array, 455 Assign Cookies, 485 Max Consecutive Ones,
496 Next Greater Element I, 561 Array Partition, 566 Reshape the Matrix, 594 Longest Harmonious
Subsequence, 605 Can Place Flowers, 628 Maximum Product of Three Numbers, 643 Maximum Average
Subarray I, 645 Set Mismatch, 674 Longest Continuous Increasing Subsequence, 704 Binary Search, 724 Find
Pivot Index, 733 Flood Fill, 744 Find Smallest Letter Greater Than Target, 746 Min Cost Climbing Stairs, 747
Largest Number At Least Twice of Others, 766 Toeplitz Matrix, 832 Flipping an Image, 844 Backspace
[Link] [Link]
String Compare, 852 Peak Index in a Mountain Array, 867 Transpose Matrix, 888 Fair Candy Swap, 896
Monotonic Array, 905 Sort Array By Parity, 922 Sort Array By Parity II, 941 Valid Mountain Array, 976
Largest Perimeter Triangle, 977 Squares of a Sorted Array, 989 Add to Array-Form of Integer, 1002 Find
Common Characters, 1005 Maximize Sum Of Array After K Negations, 1013 Partition Array Into Three Parts
With Equal Sum, 1051 Height Checker, 1089 Duplicate Zeros, 1122 Relative Sort Array, 1200 Minimum
Absolute Difference, 1207 Unique Number of Occurrences, 1232 Check If It Is a Straight Line, 1260 Shift 2D
Grid, 1299 Replace Elements with Greatest Element on Right Side, 1331 Rank Transform of an Array, 1365
How Many Numbers Are Smaller Than the Current Number, 1380 Lucky Numbers in a Matrix, 1460 Make
Two Arrays Equal by Reversing Subarrays, 1491 Average Salary Excluding the Minimum and Maximum
Salary, 1502 Can Make Arithmetic Progression From Sequence, 1539 Kth Missing Positive Number, 1572
Matrix Diagonal Sum, 1588 Sum of All Odd Length Subarrays, 1636 Sort Array by Increasing Frequency,
1720 Decode XORed Array, 1732 Find the Highest Altitude, 1748 Sum of Unique Elements, 1752 Check if
Array Is Sorted and Rotated, 2215 Find the Difference of Two Arrays.

===========================================================
= PHASE 2: CORE JAVA
Duration: 10 Days x 6 Hours = 60 Hours
LeetCode Target: 120 Problems
Cumulative LeetCode Target Before Competitive Coding: 350 Problems
============================================================

Phase Objective:
To prepare students for Java placement interviews and strengthen object-oriented programming, exception
handling, collections, file handling, generics, lambda basics and Java coding style.

Expected Outcome:
Students should be able to explain Core Java concepts and use Java Collections effectively in coding
problems.

[Link] [Link]

You might also like