Pattern 11

Beginner Problems Patterns Easy
  • While this problem may seem trivial, the concept underlying it - pattern recognition and generation, is frequently used in software development
  • For example, in web development, design patterns such as MVC (Model View Controller) and MVVM (Model View ViewModel) are used
  • In artificial intelligence, machine learning algorithms often use pattern recognition to make predictions or decisions without being specifically programmed to perform the task
  • Consequently, having a solid understanding of simple pattern generation problems like this one can build a foundation for understanding more complex pattern-related concepts in various fields of software development and data science

Given an integer n. You need to recreate the pattern given below for any value of N. Let's say for N = 5, the pattern should look like as below:


0 1 

1 0 1 

0 1 0 1 

1 0 1 0 1


Print the pattern in the function given to you.

Constraints

  • 1 <= n <= 20

Company Tags

TCS Cognizant Accenture Infosys Capgemini Wipro IBM HCL Tech Mahindra MindTree