oracle面试问题_Oracle编码面试问题
oracle面试问题
日常编码问题 (Daily coding problems)
They are a wide variety of questions inspired by real programming interviews, with in-depth solutions that clearly take you through each core concept.
它们是受实际编程访谈启发的各种各样的问题,其深入的解决方案可以使您清楚地了解每个核心概念。
Get exceptionally good at coding interviews by solving one problem every day.
通过每天解决一个问题,特别擅长编码面试。
We will together solve these problems using JavaScript.
我们将一起使用JavaScript解决这些问题。
问题1 (Problem #1)
题 (Question)
We say a number is sparse if there are no adjacent ones in its binary representation.
我们说如果数字的二进制表示中没有相邻的数字,则它是稀疏的。
For example,
Do this in faster than
O(N log N)time.
这样做的时间比
O(N log N)时间快。
解 (Solution)
First of all, convert a integer to binary as follows.
首先,将整数转换为二进制,如下所示。
Then we implement the following
get_next_sparse(num)function that returns the smallest sparse number greater than or equal
num.
然后,我们实现以下
get_next_sparse(num)函数,该函数返回大于或等于
num的最小稀疏数。
We loop through an array of string and break when the current digit and previous digit are equal to the string of 1 and then create the array of zeros as follows.
我们遍历字符串数组,并在当前数字和前一位数字等于字符串1时中断,然后按如下方式创建零数组。
Finally, the output of this solution.
最后,此解决方案的输出。
console.log(get_next_sparse(21))
<< 21console.log(get_next_sparse(25))
<< 32
Easy, right?
容易吧?
I will update new problems that were asked by Oracle in this article, please 🔖 it to read again and get the latest problems and solutions.
我将更新本文中Oracle提出的新问题,请🔖重新阅读以获取最新的问题和解决方案。
Thanks for reading!
谢谢阅读!
翻译自: https://medium.com/javascript-in-plain-english/oracle-coding-interview-questions-5af5f1e13de8
oracle面试问题
- ORACLE 面试问题-技术篇
- Oracle面试常见的二十个问题及回答
- ORACLE 面试问题-技术篇(1)
- Linux下oracle中文编码设置问题
- Spring+Hibernate+Struts+Oracle的编码问题
- ORACLE 面试问题-技术篇 [转]
- oracle 编码问题|编码处理|编码设置
- 连接不同字符集编码Oracle问题处理过程
- Oracle ERP 财务顾问面试的常见问题--欢迎补充
- oracle面试问题
- Oracle技术面试问题
- Oracle加解密_解决编码问题_解决中文截断问题
- 面试常见问题整理----oracle
- ORACLE 面试问题-技术篇
- Oracle面试问题-技术篇
- 如何应对ORACLE面试中的问题
- 讲解Oracle面试过程中常见的二十个问题
- oracle:编码问题,中文显示乱码,两个client
- Oracle面试过程中常见的二十个问题
- 修改ORACLE客户端字符集编码解决中文乱码问题