Leetcode
  • Posts
  • Tag Index
  • Search
Navigation bar avatar

613 - Shortest Distance in a Line

Posted on August 4, 2017 · < 1 minute read
Welcome to Subscribe On Youtube

Formatted question description: https://leetcode.ca/all/613.html

613. Shortest Distance in a Line (Easy)

SQL Schema

Solution 1.

# OJ: https://leetcode.com/problems/shortest-distance-in-a-line/

SELECT
    MIN(ABS(p1.x - p2.x)) AS shortest
FROM
    point p1
        JOIN
    point p2 ON p1.x != p2.x

All Problems

All Solutions

Share: Twitter Facebook LinkedIn
  • ← Previous Post
  • Next Post →
  • RSS
  • Email me

Leetcode  •  2023  •  leetcode.ca

Copyright © 2023 leetcode.ca