Skip to content

Saralyn's pull request for Code Review Activity#1

Open
SaralynOgden wants to merge 1 commit intomainfrom
Saralyn_Ogden_CodeReview
Open

Saralyn's pull request for Code Review Activity#1
SaralynOgden wants to merge 1 commit intomainfrom
Saralyn_Ogden_CodeReview

Conversation

@SaralynOgden
Copy link

No description provided.

@sarafarag sarafarag requested a review from seanfite June 15, 2023 17:59
Copy link

@seanfite seanfite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, the main thing I would change is the fail("Not yet implemented") lines from the test cases

@Test
public void testRemoveNthCharacter4() {
fail("Not yet implemented");
manipulatedstring.setString("I'd b3tt3r put s0me d161ts in this 5tr1n6, right?");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change to assertEquals("") and not have all the whitespace

@seanfite
Copy link

seanfite commented Jun 19, 2023 via email

@SWE-CS410 SWE-CS410 deleted a comment from SaralynOgden Jun 19, 2023
@SWE-CS410 SWE-CS410 deleted a comment from sarafarag Jun 19, 2023
for (int i = 0; i < string.length(); i++) {
if ((i + 1) % n == 0) {
if (maintainSpacing) {
stringBuilder.append(" ");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think changing .append to .deleteCharAt() could add some optimization by possibly avoiding creating a new string for each character removal

public String restoreString(int[] indices) {
return null;
}
public String restoreString(int[] indices){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding more descriptive object names to enhance readability

@Test
public void testCount4() {
fail("Not yet implemented");
manipulatedstring.setString(
Copy link

@seanfite seanfite Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability, it might be better to create this string via a random char generator in a loop so it doesn't fill up so much space.

Copy link

@seanfite seanfite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Firstly, so sorry for the first review. I had the wrong impression about the text lines highlighted red. Overall great code, some tiny optimization suggestions that could help but not necessarily required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants