Thread: Urgent!!!C Beginner (ANYONE know how to solve this?)

  1. #1
    Registered User
    Join Date
    Dec 2021
    Posts
    6

    Post Urgent!!!C Beginner (ANYONE know how to solve this?)

    Anyone know how to solve this???
    A 8-years old boy was learning to play Piano. He played several musical notes that are combination of ‘C’, ‘D’, ‘E’, ‘F’, ‘G’. For example, he played "CCGCCGGCCG" on the Piano.
    He wants to identify repeated sequences within his played musical notes.
    Given a string s that represents a sequence of musical notes, write a program to return all the 10-letter-long sequences (substrings) that occur more than once in the s. You may return the answer in any order.
    Example 1:
    Input: s = "CCCCCDDDDDCCCCCDDDDDCCCCCFFGG" Output: CCCCCDDDDD
    CCCCDDDDDC CCCDDDDDCC CCDDDDDCCC CDDDDDCCCC DDDDDCCCCC
    Example 2:
    Input: s = "CCCCCCCCCCCCC"
    Output: CCCCCCCCCC

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    You code, we help - that's the deal.
    https://cboard.cprogramming.com/announcement.php?a=39

    You need to spend some actual time and effort demonstrating that you've at least thought about the problem and made an attempt at solving it.

    Just copy/pasting your assignment two minutes after reading it just because "this is too difficult" isn't going to help you at all.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 08-05-2013, 12:59 PM
  2. beginner and need help to solve my morse code / text
    By tnkanubite in forum C++ Programming
    Replies: 1
    Last Post: 01-20-2012, 06:47 AM
  3. Solve This Problem Within 3 Hr Urgent Need
    By annum in forum C Programming
    Replies: 12
    Last Post: 10-04-2009, 09:56 AM
  4. beginner plzz help urgent
    By sara101 in forum C Programming
    Replies: 11
    Last Post: 01-14-2007, 10:38 PM
  5. Beginner needs help w/ran. nums. in arrays - URGENT!
    By madhouse199 in forum C++ Programming
    Replies: 3
    Last Post: 12-12-2001, 07:12 AM

Tags for this Thread