LeetCode May Challenge – Check If It Is a Straight Line – [8. GÜN]

LeetCode’un mayıs ayı için her gün bir programlama sorusu sorduğu “May Challenge”‘ın sekizinci gün sorusu “Check If It Is a Straight Line””ın açıklaması ve çözümü.

🔥 LeetCode May Challenge: https://leetcode.com/explore/featured/card/may-leetcoding-challenge

➡️ Problem açıklaması:

You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane.

Input: coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]

Output: true

Input: coordinates = [[1,1],[2,2],[3,4],[4,5],[5,6],[7,7]]

Output: false

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.