Skip to content

Saralyn's pull request for Code Review Activity#1

Open
SaralynOgden wants to merge 1 commit into
mainfrom
Saralyn_Ogden_CodeReview
Open

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

Conversation

@SaralynOgden

Copy link
Copy Markdown

No description provided.

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

@seanfite seanfite left a comment

Copy link
Copy Markdown

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?");

Copy link
Copy Markdown

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

seanfite commented Jun 19, 2023 via email

Copy link
Copy Markdown

@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(" ");

Copy link
Copy Markdown

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){

Copy link
Copy Markdown

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(

@seanfite seanfite Jun 19, 2023

Copy link
Copy Markdown

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.

@seanfite seanfite left a comment

Copy link
Copy Markdown

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