Skip to content

Wrong answer at line number 264 #18

@rushikeshshinde578

Description

@rushikeshshinde578

The function you've written is almost correct, but there's a small mistake in the loop condition. The loop should iterate until str.length, not str.length-1. This is because array indices in JavaScript (and most programming languages) are 0-based, meaning the last index is length-1. By using str.length-1, you're missing the last character in the string.

(var i=0; i<str.length; i++)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions