Skip to content

Instantly share code, notes, and snippets.

@autolyticus
Created April 10, 2019 16:43
Show Gist options
  • Select an option

  • Save autolyticus/46009b2eaa13bad28b69ce7b45a24bb6 to your computer and use it in GitHub Desktop.

Select an option

Save autolyticus/46009b2eaa13bad28b69ce7b45a24bb6 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 g <g@host>
#
# Distributed under terms of the MIT license.
# 11 - 1
n, m = map(int, input().split())
a = list(sorted((map(int, input().split()))))
print(list(sorted([a[i+m-1] - a[i] for i in range(0, len(a)-m)]))[0], end='')
# 11 - 2
print(*sorted(input().split(',')), sep=',', end='')
# 11 - 3
a = input().split()
print(*filter(lambda x: x != '0', a), *filter(lambda x: x == '0', a), end='')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment