| layout | title | published | permalink | description |
|---|---|---|---|---|
normal |
SRM 2015 Web developers |
true |
srmcb2015/ |
Codebrahma SRM Questions |
- You have 90 minutes time.
- There are infinite ways to solve these problems. If two people submit identical solutions, both of them will be rejected.
- If you are not comfortable with Javascript, you can use https://code.hackerearth.com and solve it any preferred language. (Make sure you save it before submitting the URL.)
- Last 2 questions have a fiddle associated, fork the fiddle and implement the solution on the browser and save your answer. Call one of the Codebrahma team members and get your output verified.
- Note: The last 2 questions needs to be solved only in Javascript.
- The last question has bonus marks.
- Submit your responses by filling this form.
Ironman decides to marry a girl. Impressed by the skills of Ironman, he got proposal from N girls. Ironman will only prefer girls who have some special superpowers. Superpowers are represented by positive non-zero integers. Ironman has a list of M superpowers which he wants in a girl. He can also consider those girls who have some extra superpowers, but they should have at least all superpowers which Ironman wants. Find how many girls' proposal Ironman will consider.
Input: First line contains the integer M, the number of superpowers which Ironman wants. Second line contains M single space separated distinct integers (superpowers). Third line contains an integer N, the number of girls. Next follow N lines, ith line contains few single-space separated distinct integers, denoting the superpowers of the ith girl.
Output: Print the number of girls shortlisted by Ironman.
Use this Editor to solve the problem in your favorite language.
Create a function that will flatten an array using JavaScript.
Example:
| Sample Input | Sample Output |
|---|---|
| ["i", ["c", "o", "d"], 3, ["b", "r"], "h", "m", "a"] | ["i", "c", "o", "d", 3, "b", "r", "h", "m", "a"] |
Implement the functionality in the given JS Fiddle
Observe the following video carefully.
In case the video isn't working refer this.
First text box takes the size of candy (in px) and the second text box takes the number of flavors of the candy. You show draw a candy of the given flavors and size. You need to generate random flavors (colors) for candy.
Implement the functionality in the given JS Fiddle
