zoukankan      html  css  js  c++  java
  • Shortest distance between two arrays

    Given two sorted array in non-descending order, each contains positive integers
    The distance is define as following
    pick up a number from each array, compute their difference
    return the shortest distance among them-that's the distance between the two arrays
    example
    int[] a = {1, 3, 5, 7 , 9} ;
    int[] b = {2, 4, 8} ;
    The result is 1

    Code
  • 相关阅读:
    hive查询语句合并问题
    hive isnull或ifnull的替代方法if()方法
    hive科学计数法引发的问题
    科学计数法转字符串
    shell命令执行结果$?
    shell脚本中变量接受hive语句的返回值问题
    shell简单命令
    js切换图片
    js点击图片切换
    操作节点
  • 原文地址:https://www.cnblogs.com/graphics/p/1498122.html
Copyright © 2011-2022 走看看