All Questions
636
questions
3
votes
1
answer
166
views
Snail matrix in Java - version III (generalizing)
Once again, in the previous version,
Alexander Ivanchenko helped me with his awesome answer.
Now, I have improved the toString() and, also, generalized the class ...
4
votes
2
answers
108
views
(Another) text formatting method with word wrapping in Java
Please take a look at my code for (simply) formatting/wrapping a text. Is there something to improve?
Here are the properties the method should have: (updated)
Every space character (i.e. ...
3
votes
3
answers
144
views
Redouble each occurrence of char recursively, and add n
In following of this question, I would like to have a second review.
The exercise is to write a recursive method that takes a String and a ...
4
votes
1
answer
265
views
Print columns of text without hard coding the width (attempt 2)
If you'd like to print this:
One Two Three Four
1 2 3 4
using this:
...
3
votes
1
answer
119
views
Print columns of text without hard coding the width
If you'd like to print this:
One Two Three Four
1 2 3 4
using this:
...
-2
votes
1
answer
391
views
Number Plate Generation Program
I wrote a number plate generation program. The program generates number plates for a car registered with a specific Memory Tag and on a specific date.
Number plates use the following format: (2 letter ...
1
vote
3
answers
77
views
FileIO lines to String Converter
I think I made a good FileIO object because I can simply copy-paste whenever I need, however I wonder How I can improve my code.
This code takes file path of the target file and turns every line to ...
2
votes
1
answer
175
views
An evolutionary algorithm written in Java to crack an XOR cipher
Alright. So TryHackme is a website that tries to teach hacking with hands on labs. They have a room called JVM Reverse Engineering where the user gets to reverse engineer Java apps, and in particular ...
4
votes
2
answers
1k
views
Add a number to a file name if does not exist or increase the number if it exist
I'm currently working on a solution to add a number to a file name if the number does not exist or increase de number by one if the number exist.
For instance if you input "filename.jpeg" ...
4
votes
6
answers
1k
views
Reverse string with identical spaces as in original String using Java
This is interview question
Reverse string with identical spaces as in original String using Java
For example
Original String :
best in the world and is greatest and is making sure the world goes
well
...
3
votes
5
answers
551
views
Frame Strings that contain newlines
I have an application where I need to highlight some information that is printed to the console, so I wrote some static library methods which do that. I tested for bugs. Is my code clean and ...
2
votes
1
answer
128
views
Related to DSA: Find longest common prefix
The objective of below code is find longest common prefix from trie DataStructure which is written in Java.
Code:
...
7
votes
2
answers
692
views
Concat two strings by slicing them with same length
I want to concat two strings, by sub-stringing each one with same length, and concatenation should happen like I mentioned below
for suppose,
I have str1 = raines, str2 = bowls, and LENGTH as 2, then ...
-1
votes
2
answers
145
views
New String similarity algorithm (java)
Recently I have been developing a library for Java which provides utility functions for arrays, strings, etc.. While researching string similarity algorithms, I managed to write one of my own. I am ...
1
vote
0
answers
437
views
Java reimplementation of the Python difflib.SequenceMatcher class
I'm rewriting a Python script into an Android app. This script uses difflib.SequenceMatcher to compare sequence of strings. I haven't been able to find something ...