Chef Loves Patterns
CodeChefOpen on judge ↗
Problem Statement Given N, help CodeChef to print patterns up to N lines. For e.g. For N=6, the following pattern will be printed. Note: For every odd number row print 1, odd number of times and for every even number row , print first and last character as 1 and rest of middle characters as 0. 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 0 0 1 Input: Single Integer N. Constrains: NOutput For
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start