-
December 7th, 2020, 08:52 AM
#1
Junior Member
Can anyone Explain coding questions asked by Microsoft
How to an array of characters chars, compress it using the following algorithm: Begin with an empty string s. For each group of consecutive repeating characters in chars: If the group's length is 1, append the character to s. Otherwise, append the character followed by the group's length. The compressed string s should not be returned separately, but instead, be stored in the input character array chars. Note that group lengths that are 10 or longer will be split into multiple characters in chars. After you are done modifying the input array, return the new length of the array
Thanks & Regards
**Links removed by Site Administrator so it doesn't look like you're spamming us. Please don't post them again.**
Similar Threads
-
By JP in forum AntiOnline's General Chit Chat
Replies: 31
Last Post: June 7th, 2006, 05:56 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|