注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
整理下nordstrom所有的oa coding和bq部分题目,求大米,没到200,好多贴都看不了:(
友情提示:一定要做一下练习,ide很不一样,输入需要自己处理,结果需要打印出来!!!Programming challenge:
1. Consider a set of m x n groups, each group having some number of points in a one-dimensional space. Each point is expressed by its coordinate on a line. Write a program to choose exactly one point from every group to form a new set, such that the distance between first and last points in the new set is the minimum possible.
Input:
Each line of input contains a list of space-separated integers for each group.
For example: 21 1 150 289 -321
160 3 30
170 22 6 7
Output:A space-separated sorted list of integers of the formed set. For example: 1 3 6
2. 管理balance和transactions, 让罚款次数降到最低.
例如:
input : [1 , -10 , 1 , -8]
output: 2
2 为最低罚款次数
奉上我的答案:
import sys
from typing import List
class Solution:
def run(self, balance:int, A:List[int])-> int:
nums = sorted(A,reverse = True)
count = 0
for i in range(len(A)):
balance = balance + nums[i]
print('xx',balance,nums[i])
if balance < 0:
count = len(A) - i
您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 使用VIP即刻解锁阅读权限或查看其他获取积分的方式 游客,您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 VIP即刻解锁阅读权限 或 查看其他获取积分的方式 ive signal的日期
BQ:
1. Why are you interested in Nordstrom technology?
2. 写代码用什么editor, OS, debugger 之类?
3. What if your colleagues find faults in your work?
4. Tell me about a project you are proud of. What technology has been used?
5. Tell me about your approach to learn a new technology (new coding language or frame) and give me an example.
跪求大米,多谢大家!! |