Skip to content

Commit b255bb5

Browse files
author
Dhananjay Nagargoje
committed
java gitignore
1 parent c5e1a75 commit b255bb5

33 files changed

+170
-0
lines changed

Diff for: .gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
7+
# BlueJ files
8+
*.ctxt
9+
10+
# Mobile Tools for Java (J2ME)
11+
.mtj.tmp/
12+
13+
# Package Files #
14+
*.jar
15+
*.war
16+
*.nar
17+
*.ear
18+
*.zip
19+
*.tar.gz
20+
*.rar
21+
22+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23+
hs_err_pid*

Diff for: src/main/java/oopadesign/airlinemgmt

Whitespace-only changes.

Diff for: src/main/java/oopadesign/amazon.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/atm.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/blackjack.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/brokeragesystem.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/carrentel.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/chess.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/cricinfo.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/facebook.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/hotelmgmt.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/librarymgmt.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/linkedin.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/moviebookingticket.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/parkinglot.md

Whitespace-only changes.

Diff for: src/main/java/oopadesign/restaurant.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
public enum ReservationStatus {
2+
REQUESTED, PENDING, CONFIRMED, CHECKED_IN, CANCELED, ABANDONED
3+
}
4+
5+
public enum SeatType {
6+
REGULAR, KID, ACCESSIBLE, OTHER
7+
}
8+
9+
public enum OrderStatus {
10+
RECEIVED, PREPARING, COMPLETED, CANCELED, NONE
11+
}
12+
13+
public enum TableStatus {
14+
FREE, RESERVED, OCCUPIED, OTHER
15+
}
16+
17+
public enum AccountStatus {
18+
ACTIVE, CLOSED, CANCELED, BLACKLISTED, BLOCKED
19+
}
20+
21+
public enum PaymentStatus {
22+
UNPAID, PENDING, COMPLETED, FILLED, DECLINED, CANCELLED, ABANDONED, SETTLING, SETTLED, REFUNDED
23+
}
24+
25+
public class Address {
26+
private String streetAddress;
27+
private String city;
28+
private String state;
29+
private String zipCode;
30+
private String country;
31+
}

Diff for: src/main/java/oopadesign/stackoverflow.md

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.onRecursionAndDp;
2+
3+
public class DistinctPermu {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.onRecursionAndDp;
2+
3+
public class SubsetsWithTargetSum {
4+
}

Diff for: src/main/java/problems/onarray/MaxDistance.java

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package problems.onarray;
2+
3+
public class MaxDistance {
4+
5+
6+
/**
7+
* Given an array A of integers, find the maximum of j - i subjected to the constraint of A[i] <= A[j].
8+
*
9+
* If there is no solution possible, return -1.
10+
*
11+
* Example :
12+
*
13+
* A : [3 5 4 2]
14+
*
15+
* Output : 2
16+
* for the pair (3, 4)
17+
*/
18+
public class Solution {
19+
// DO NOT MODIFY THE LIST. IT IS READ ONLY
20+
public int maximumGap(final List<Integer> A) {
21+
if(A.size() == 0) return -1;
22+
23+
24+
int lmin[] = new int[A.size()];
25+
int rmax[] = new int[A.size()];
26+
27+
lmin[0] = A.get(0);
28+
rmax[A.size()-1] = A.get(A.size()-1);
29+
for(int i=1,j=A.size()-2;i < A.size();i++,j--) {
30+
lmin[i] = Math.min(A.get(i), lmin[i-1]);
31+
rmax[j] = Math.max(A.get(j), rmax[j+1]);
32+
}
33+
34+
int i=0, j=0, max = Integer.MIN_VALUE;
35+
36+
while(i<=j && j < rmax.length) {
37+
38+
if(lmin[i] <= rmax[j]) {
39+
max = Math.max(j-i, max);
40+
j++;
41+
} else {
42+
i++;
43+
}
44+
45+
}
46+
47+
48+
return max;
49+
}
50+
}
51+
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.onmath.gfg;
2+
3+
public class DistinctPermutations {
4+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.onsearching;
2+
3+
public class RoatetedArray {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.onsearching;
2+
3+
public class SmallestBaseAllOne {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.patterns.cyclicsort;
2+
3+
public class AllMissingNumbers {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.patterns.slidingwindows.cyclicsort;
2+
3+
public class CyclicSortBasic {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.patterns.cyclicsort;
2+
3+
public class FindDuplicate {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.patterns.cyclicsort;
2+
3+
public class MissingNumber {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.patterns.onlinkedlistreversal;
2+
3+
public class ReverseLinkedList {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package problems.patterns.slidingwindows;
2+
3+
public class LongestRepeatingCharacterReplacement {
4+
public int characterReplacement(String s, int k) {
5+
public int characterReplacement(String s, int k) {
6+
int len = s.length();
7+
int[] count = new int[26];
8+
int start = 0, maxCount = 0, maxLength = 0;
9+
for (int end = 0; end < len; end++) {
10+
maxCount = Math.max(maxCount, ++count[s.charAt(end) - 'A']);
11+
while (end - start + 1 - maxCount > k) {
12+
count[s.charAt(start) - 'A']--;
13+
start++;
14+
}
15+
maxLength = Math.max(maxLength, end - start + 1);
16+
}
17+
return maxLength;
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package problems.patterns.slidingwindows;
2+
3+
public class MaxInEachWIndow {
4+
}

0 commit comments

Comments
 (0)