An open API service indexing awesome lists of open source software.

https://github.com/jdegand/codingbat-java

Coding Bat Java Solutions
https://github.com/jdegand/codingbat-java

codingbat codingbat-solutions java

Last synced: 10 months ago
JSON representation

Coding Bat Java Solutions

Awesome Lists containing this project

README

          

# CodingBat Java Solutions

My solutions to Coding Bat Java Problems.

## Thoughts

- Recommended order to tackle problems - start with Map & Functional (Mostly self-contained with little relevance to other problems),Logic 1, String 1, Logic 2, Array 1, Warmup 1 and 2, String 2, AP-1, Recursion 1, Recursion 2, String 3, Array 2, and Array 3.
- The string-1 section relies too heavily on the substring method.
- I had most difficulty with array 3.
- I tackled AP-1 problems too late - AP-1 helps understanding some Array 2 & 3 problems easier.
- I wasn't going to bother with the warmup problems (since they give you solutions) but they actually help you solve some of the more difficult problems in the higher categories.
- A lot of my solutions were approaches that first came to mind.
- I did a lot of problems back to back at one time. I slowed down for the more difficult categories and did a fair amount of research to help solve some problems.
- There are poor directions for some problems.
- There is a decent variety of solutions to these problems out there.
- I didn't bother making classes and having proper formatted java code.

## Useful Resources

- [Baeldung](https://www.baeldung.com/java-string-interpolation) - java string interpolation
- [Stack Overflow](https://stackoverflow.com/questions/1484347/finding-the-max-min-value-in-an-array-of-primitives-using-java) - finding the max min value in an arrray of primitives using java
- [Stack Overflow](https://stackoverflow.com/questions/15217438/counting-occurrences-of-a-key-in-a-map-in-java) - counting occurrences of a key in a map in java
- [Stack Overflow](https://stackoverflow.com/questions/40197762/converting-arraylistinteger-into-int-wont-work-in-java) - converting arraylist integer into int
- [Educative](https://www.educative.io/answers/how-to-left-shift-k-elements-of-an-array) - how to left shift k elements of an array
- [Stack Overflow](https://stackoverflow.com/questions/44065154/java-break-statement-sometimes-not-work-why) - java break statement not working
- [Stack Overflow](https://stackoverflow.com/questions/9576557/most-efficient-way-to-find-smallest-of-3-numbers-java) - most efficient way to find smallest of 3 numbers
- [Baeldung](https://www.baeldung.com/java-count-chars) - java count chars
- [Stack Overflow](https://stackoverflow.com/questions/13386107/how-to-remove-single-character-from-a-string-by-index) - how to remove single character from a string by index
- [C Sharp Corner](https://www.c-sharpcorner.com/article/how-can-i-get-last-characters-of-a-string-in-java/#:~:text=If%20we%20want%20to%20get,charAt(11)%22) - get last characters of a string
- [Baeldung](https://www.baeldung.com/java-string-split-multiple-delimiters) - split string with multiple delimiters
- [Stack Overflow](https://stackoverflow.com/questions/4982210/find-the-max-of-3-numbers-in-java-with-different-data-types) - find the max of 3 in java with different data types
- [Stack Overflow](https://stackoverflow.com/questions/17235719/determining-if-a-list-numbers-are-sequential) - determining if a list numbers are sequential
- [YouTube](https://www.youtube.com/watch?v=ir_acNo6BSc) - How to Shift Elements in an Array (Java) - Modified CodingBat Question
- [Geeks for Geeks](https://www.geeksforgeeks.org/split-array-two-equal-sum-subarrays/) - split array 2 equal sum subarrays
- [Stack Overflow](https://stackoverflow.com/questions/4968323/java-parse-int-value-from-a-char) - java parse int value from a char
- [Stack Overflow](https://stackoverflow.com/questions/7569335/reverse-a-string-in-java) - reverse a string
- [Stack Overflow](https://stackoverflow.com/questions/8777982/issue-with-java-regex-b) - issue with java regex b
- [Stack Overflow](https://stackoverflow.com/questions/29777696/fastest-way-to-sort-an-array-of-objects-in-java) - fastest way to sort an array of objects in java
- [Tutorials Point](https://www.tutorialspoint.com/How-to-divide-an-array-into-half-in-java) - divide an array in half
- [Stack Overflow](https://stackoverflow.com/questions/3389264/how-to-get-the-separate-digits-of-an-int-number) - separate digits of an int number
- [Stack Overflow](https://stackoverflow.com/questions/37569841/getting-the-first-character-of-each-word-in-a-string-array-and-its-frequency) - getting first character of each word in string array and its frequency
- [Stack Overflow](https://stackoverflow.com/questions/4150233/remove-null-value-from-string-array-in-java) - remove null value from string array