Mamak
https://www.hackerrank.com/contests/codenection-2021-closed-category/challenges/mamak
Last updated
https://www.hackerrank.com/contests/codenection-2021-closed-category/challenges/mamak
Last updated
MMU is setting up a new menu for N restaurants in the campus. Each restaurant can only serve one type of food and there are 4 different types of food available numbered as 1,2,3,4 (Mee Goreng, Nasi Goreng, Nasi Lemak, Roti). The MMU authority wants the students to have a varied diet. Each student has 2 favorite restaurants, the authority wants these two restaurants to have different menus so that the student can choose between at least two types of food. No restaurant is a favorite of more that 3 students.
Input consists of two integers N and M. Next M lines contain two different integers a and b, the favorite restaurant of the ith student.
Output an N digit number, each digit in range (1..4) which describes the type of food to be included in the menu of ith restaurant. Print the smallest possible such number.
Sample Input 0