Sort by

recency

|

3941 Discussions

|

  • + 0 comments

    Locksmith Course London offers hands-on training for those looking to build a secure future in the trade. Learn essential skills, from lock picking to security system installation, with expert guidance. Just like number line jumps help students grasp math concepts step-by-step, this course breaks down locksmithing into manageable parts. Whether you're starting fresh or upgrading your skills, this course opens doors—literally and figuratively—to new career opportunities in Liverpool and beyond.

  • + 0 comments

    Simple solution in Java using boolean

    public static String kangaroo(int x1, int v1, int x2, int v2) {
            
            boolean canMeet = v2 < v1 && ((x2 -  x1) % (v1 - v2) == 0);
            
            return canMeet? "YES": "NO";
        }
    
  • + 0 comments

    C# solution:

    string result = "NO";
        if (v1 <= v2)
        {
            return result;
        }
        if ((x2 - x1) % (v1 - v2) == 0)
        {
            result = "YES";
        }
        return result;
    
  • + 0 comments

    Simple Mathematical Solution in JavaScript

    
    
    function kangaroo(x1, v1, x2, v2) {
        // Write your code here
        // Solve for t: x1 + d1 * t = x2 + d2 * t
        let t = (x2 - x1) / (v1 - v2);
    
        // If t is negative, they never meet in forward time
        if (t < 0 || !Number.isInteger(t)) {
            return "NO";
        }
    
        return "YES";
    
    }
    
    
    
  • + 0 comments

    Corner case, where: x1 = x2 and v1 = v2 ?

    Answer: is "YES" the two congoroos meet after one jump at v1 = v2